﻿using System;
using System.Collections.Generic;
using System.Text;
using Catalina.Common;

namespace Catalina.Dal
{
	class CatalinaHeaderMapper : MapperBase<CatalinaHeader>
	{
		protected override CatalinaHeader Map(System.Data.IDataRecord record)
		{
			try
			{
				String batchNo = FromDB<String>(record["BatchNo"]);
				String description = FromDB<String>(record["Description"]);
				int printable = FromDB<int>(record["Printable"]);
				DateTime startDate = FromDB<DateTime>(record["StartDate"]);
				DateTime endDate = FromDB<DateTime>(record["EndDate"]);

				return new CatalinaHeader(batchNo, description, printable, startDate, endDate);
			}
			catch
			{
				throw;
			}
		}
	}
}
